const fs=require('fs');
const path=require('path');
// const MongoClient=require('mongodb').MongoClient;
const xtpl=require('xtpl');
const databasemanager=require('../tools/databasemanger.js');
//获取学生列表
exports.studentmanager=(req,res)=>{
databasemanager.findList('studentinfo',{},(err,docs)=>{
  console.log(docs);
  xtpl.renderFile(path.join(__dirname,"../views/studentlist.html"),{studentlist:docs},(err,data)=>{
    xtpl.renderFile(path.join(__dirname,"../views/studentlist.html"),{studentlist:docs},(err,data)=>{
    if(err){
      console.log(err);
    }
    res.end(data);
  })
})
 
}
